
var GRID_SIZE:number = 32;
var GRID_COLUMNS:number = 15;
var GRID_ROWS:number = 25;
var KEY_LEFT:string = "65";//a
var KEY_RIGHT:string = "68";//d
var KEY_DOWN:string = "83";//s
var KEY_UP:string = "87";//w
var KEY_RESTART:string = "13|108";//enter

var INIIAL_LEN:number = 3;//初始长度
var INITIAL_SNAKE_SPEED:number = 10;
var INITIAL_UNIT_SPEED:number = 25;

var MAX_FOOD_IN_SCENE:number = 2;
var MAX_FOOD_LIFE:number = 10;
var TWINKLE_FOOD_LIFE:number = 3;

function init_conf(o:Object):void{
	if(o == null){
		return;
	}
	for(let key in o){
		window[key] = o[key];
	}
}

function isPress(keyCode:number,keyType:string):boolean{
	return keyType.indexOf(""+keyCode) >= 0;
}

